package com.leecode;

public class Leet62 {
	public static void main(String[] args) {

	}

	/**
	 * 100%,86%
	 */
	public int uniquePaths(int m, int n) {
		int[][] dp = new int[m][n];
		for (int a = 0; a < n; a++) {//set first line 1
			dp[0][a] = 1;
		}
		for (int a = 0; a < m; a++) {//set first column 1
			dp[a][0] = 1;
		}
		for (int a = 1; a < m; a++) {
			for (int b = 1; b < n; b++) {
				dp[a][b] = dp[a - 1][b] + dp[a][b - 1];
			}
		}

		return dp[m - 1][n - 1];
	}
}
